package com.rightrule.rule.executor;

import com.alibaba.fastjson.JSON;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;
import java.util.Map;

/**
 * 运行时上下文
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class RuntimeContext {
    private String ipid;
    private String ipRoleId;
    private String businessId;

    /**
     * only for offline task
     **/
    private boolean isOfflineTask;
    private Long strategyId;
    private Long strategyVersionId;
    private String policyTag;

    /**
     * 决策参数
     **/
    private String invoker;
    private String invokerFlowID;
    private Integer decisionNodeId;
    private Integer packageId;

    /**
     * 决策入参JSON
     */
    private Map<String, Object> inputFields;

    /**
     * 当前决策seq
     */
    private String seq;


    /**
     * 是否保留决策流水
     */
    private boolean saveAllFiredWater = true;

    /**
     * 规则执行追踪
     */
    private List<String> ruleTrace;

    @Override
    public String toString() {
        return JSON.toJSONString(this);

    }


}
